Inside Macintosh: Macintosh Toolbox Essentials

Previous | Chapter Top | Chapter Contents | Next

Manipulating the Desktop

This section describes the functions that let your application retrieve information about the desktop and set the desktop pattern. Ordinarily, your application doesn't need to manipulate any part of the desktop outside of its own windows.

SetDeskCPat

Sets the desktop pattern on a computer that supports Color QuickDraw.

pascal void SetDeskCPat (PixPatHandle deskPixPat);
deskPixPat
A handle to a pixel pattern.

DESCRIPTION

The SetDeskCPat function sets the desktop pattern to a specified pixel pattern, which can be drawn in more than two colors. After a call to SetDeskCPat , the desktop is automatically redrawn in the new pattern. If the specified pattern is a binary pattern (with a pattern type of 0), it is drawn is the current foreground and background colors. If the value of the deskPixPat parameter is nil , SetDeskCPat uses the standard binary desk pattern (that is, the 'ppat' resource with resource ID 16).

For compatibility with other Macintosh applications and the system software, applications should ordinarily not change the desktop pattern.

The Window Manager's desktop-painting functions can paint the desktop either in the binary pattern stored in the global variable DeskPattern or in a new pixel pattern. The desktop pattern used at startup is determined by the value of the parameter-RAM bit flag called pCDeskPat . If the value of pCDeskPat is 0, the Window Manager uses the new pixel pattern; if not, it uses the binary pattern stored in DeskPattern . The user can change the color pattern through the General Controls panel, which changes the value of pCDeskPat .

LMGetDeskPattern

Gets the value of the global variable DeskPattern .

pascal void LMGetDeskPattern (Pattern *deskPatternValue);
deskPatternValue
A pointer to the address at which LMGetDeskPattern returns the pixel pattern contained in the global variable DeskPattern .

LMSetGrayRgn

Sets the handle to the region interpreted by the Window Manager as the current desktop region.

pascal void LMSetGrayRgn (RgnHandle value);
value
A handle to the region you want to set as the current desktop region.

DESCRIPTION

The LMSetGrayRgn function sets the value of the low-memory global GrayRgn , which contains a handle to a region interpreted by the Window Manager as the current desktop region.

SEE ALSO

To get a handle to the current desktop region, use GetGrayRgn (GetGrayRgn) .

GetGrayRgn

Returns a handle to the current desktop region.

pascal RgnHandle GetGrayRgn (void);

DESCRIPTION

The GetGrayRgn function returns a handle to the current desktop region from the global variable GrayRgn .

The desktop region represents all available screen space, that is, the desktop area displayed by all monitors attached to the computer. Ordinarily, your application doesn't need to access the desktop region directly.

When your application calls DragWindow (DragWindow) to let the user drag a window, it can use GetGrayRgn to set the limiting rectangle to the entire desktop area.

LMSetWMgrPort

Sets the Window Manager port.

pascal void LMSetWMgrPort (GrafPtr value);
value
A pointer to the graphics port you want to set as the Window Manger port.

DESCRIPTION

The LMSetGrayRgn function sets the value of the low-memory global WMgrPort , which contains a pointer to the port interpreted by the Window Manager as the Window Manager port.

GetCWMgrPort

Gets a pointer to the Window Manager port on a system that supports Color QuickDraw.

pascal void GetCWMgrPort (CGrafPtr *wMgrCPort);
wMgrCPort
A pointer to an address at which GetCWMgrPort places a pointer to the Window Manager port.

DESCRIPTION

The GetCWMgrPort function places a pointer to the color Window Manager port in the value referenced through the parameter wMgrCPort . The GetCWMgrPort function is available only on computers with Color QuickDraw.

The Window Manager port is a graphics port that occupies all of the main screen. Ordinarily, your application doesn't need to access the Window Manager port.

Do not change any regions of the Window Manager port. If you do, the Window Manager might not handle overlapping windows properly.

GetWMgrPort

Gets a pointer to the Window Manager port on a system with only the original monochrome QuickDraw.

pascal void GetWMgrPort (GrafPtr *wPort);
wPort
A pointer to an address at which GetWMgrPort places a pointer to the Window Manager port.

DESCRIPTION

The GetWMgrPort function places a pointer to the Window Manager port in the value referenced through the parameter wPort .

The Window Manager port is a graphics port that occupies all of the main screen. Ordinarily, your application doesn't need to access the Window Manager port.

Do not change any regions of the Window Manager port. If you do, the Window Manager might not handle overlapping windows properly.


© 1997 Apple Computer, Inc.

Previous | Chapter Top | Chapter Contents | Next